import request from '@/utils/request'

export const getCategories = (params) => {
  return request({
    method: 'get',
    url: '/private/v1/categories',
    params,
  })
}
// 添加分类
export const addCategories = (data) => {
  return request({
    method: 'post',
    url: '/private/v1/categories',
    data,
  })
}
// 获取单个分类信息
export const getCategoriesDetail = (id) => {
  return request({
    method: 'get',
    url: '/private/v1/categories/' + id,
  })
}
// 编辑提交分类
export const editCategories = (id, data) => {
  return request({
    method: 'put',
    url: '/private/v1/categories/' + id,
    data,
  })
}
// 删除分类
export const delCategories = (id) => {
  return request({
    method: 'delete',
    url: '/private/v1/categories/' + id,
  })
}
